package com.itheima.action;

import com.itheima.domain.Customer;
import com.itheima.domain.Linkman;
import com.itheima.service.QueryService;
import com.opensymphony.xwork2.ActionSupport;

import java.util.List;

/**
 * Created by Mr.King on 2017/2/28.
 */
public class QueryAction extends ActionSupport {

    private QueryService service;
    public void setService(QueryService service) {
        this.service = service;
    }

    private List list;
    public List getList() {
        return list;
    }

    private Customer customer = new Customer();
    public Customer getCustomer() {
        return customer;
    }

    private Linkman linkman = new Linkman();
    public Linkman getLinkman() {
        return linkman;
    }

    //综合查询---客户
    public String selectCustomer(){
        return "selectCustomer";
    }

    //查询
    public String findCustomer(){
        list = service.findCustomer(customer);
        return "customerList";
    }

    //综合查询--联系人
    public String selectLinkman(){
        return "selectLinkman";
    }

    //查询
    public String findLinkman(){
        list =  service.findLinkman(linkman);
        return "linkmanList";
    }

    //分析统计--客户行业统计
    public String statisticsIndustry(){
        list = service.countIndustry();
        return "statisticsIndustry";
    }
    //分析统计--客户行业来源
    public String statisticsSource(){
        list = service.countSource();
        return "statisticsSource";
    }
}
